package auctioncentral;

/**
 * 
 * This class encapsulates a bid placed by a registered bidder. 
 * 
 * @author Keenan Fejeran
 * @version 2/25/2014
 *
 */
public class Bid {
	
	/** The amount of dollars of this bid. **/
	private double my_amount;
	
	/** The user who bid on the item. **/
	private String my_bidder;
	
	/** The item that this bid is for. **/
	private int my_item_id;
	
	/**
	 * Default Constructor for a bid.
	 * 
	 * @param the_amount the amount of money for this bid.
	 * @param the_bidder the bidder who bid.
	 * @param the_item the item that was bid on.
	 */
	public Bid(final double the_amount, final String the_bidder, final int the_item_id) {
		my_amount = the_amount;
		my_bidder = the_bidder;
		my_item_id = the_item_id;
	}
	
	/**
	 * Returns the amount of money on this bid.
	 * 
	 * @return the amount of money on this bid.
	 */
	public double getAmount() {
		return my_amount;
	}
	
	/**
	 * Returns the user who made this bid.
	 * 
	 * @return the user who made this bid.
	 */
	public String getBidder() {
		return my_bidder;
	}
	
	/**
	 * Returns the item that this bid is on.
	 * 
	 * @return the item that this bid is on.
	 */
	public int getItemId() {
		return my_item_id;
	}
	
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
	  String s = my_amount + " " + my_bidder + " " + my_item_id;
	  return s;
	}
}
